<template>
	<view :class="[primarySize()]">
		<view class="item" v-for="(item, index) in jobs">
			<view class="flex-box lh50">
				<view class="col3 fs36 fwb">{{item.name}}</view>
				<view class="tips ml10">{{item.category.name}}</view>
				<view class="flex-grow-1 tr col4 fs28 fwb">线下课程</view>
			</view>
			<view class="mt15 fs24 col6 lh32">{{item.institution.name}}</view>
			<view class="flex-box mt20">
				<view class="flex-grow-1 lh34">
					<view class="col6 fs24">计划{{item.plan_count}}人</view>
					<view class="flex-box mt20">
						<image src="@/static/public/icon_time.png" mode="widthFix" class="ico24"></image>
						<view class="pl10 col9 fs22">{{item.train_start_text}}至{{item.train_end_text}}</view>
					</view>
				</view>
				<block v-if="!trainType">
					<view @click="bindDetail(item.id)" class="btn ac" v-if="item.enroll_status == 1">立即报名</view>
					<view class="btn" v-else-if="item.enroll_status == 2">已报满</view>
				</block>
			</view>
		</view>
		
	
	</view>
</template>

<script>
	const app = getApp();
	export default {
		name: "train-list",
		props: {
			jobs: {
				type: Array,
				default: []
			},
			trainType: {
				type: String,
				default: ''
			}
		},
		data() {
			return {
				primary:''
			};
		},
		created() {
			;
		},
		methods: {
			bindDetail(id){
				uni.navigateTo({
					url: '/pages/user/train_info?id='+id
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.item {
		width: 690rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.03);
		border-radius: 18rpx;
		padding: 30rpx;
		margin-top: 20rpx;
	
		.tips {
			font-size: 24rpx;
			color: var(--primary);
			padding: 0 6rpx;
			height: 37rpx;
			line-height: 33rpx;
			border-radius: 6rpx;
			border: 2rpx solid var(--primary);
		}
	}
	.btn {
		width: 166rpx;
		height: 62rpx;
		line-height: 62rpx;
		text-align: center;
		font-size: 28rpx;
		color: #FFFFFF;
		background: #C3C3C3;
		border-radius: 8rpx;
	
		&.ac {
			background: var(--primary);
		}
	}

</style>